package us.styx.net;

import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;

import us.styx.net.codec.CummulativeProtocolDecoder;
import us.styx.net.codec.LoginProtocolDecoder.LoginState;

public class Client {
    
    private LoginState loginState;

    private CummulativeProtocolDecoder protocolDecoder;

    private ByteBuffer buffer;
    
    private SelectionKey key;
    
    private SocketChannel channel;
    
    private boolean isLoggedIn = false;

    public Client(SelectionKey key) {
	setKey(key);
    }

    public CummulativeProtocolDecoder getProtocolDecoder() {
	return protocolDecoder;
    }

    public void setProtocolDecoder(CummulativeProtocolDecoder protocolDecoder) {
	this.protocolDecoder = protocolDecoder;
    }

    public LoginState getLoginState() {
	return loginState;
    }

    public void setLoginState(LoginState state) {
	this.loginState = state;
    }

    public ByteBuffer getBuffer() {
	return buffer;
    }

    public void setBuffer(ByteBuffer buffer) {
	this.buffer = buffer;
    }

    public SelectionKey getKey() {
	return key;
    }

    public void setKey(SelectionKey key) {
	this.key = key;
    }

    public SocketChannel getChannel() {
	return channel;
    }

    public void setChannel(SocketChannel channel) {
	this.channel = channel;
    }

    public boolean isLoggedIn() {
	return isLoggedIn;
    }

    public void setLoggedIn(boolean isLoggedIn) {
	this.isLoggedIn = isLoggedIn;
    }
}